package com.wyh.service.serviceImpl.gfiveImpl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wyh.domain.po.gfive.UserRole;
import com.wyh.service.gfive.UserRoleService;
import com.wyh.mapper.gfivemapper.UserRoleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author KmJHHhhhR
 * @description 针对表【user_role(用户角色表)】的数据库操作Service实现
 * @createDate 2024-05-20 15:03:04
 */
@Service
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole>
        implements UserRoleService {
    @Autowired
    UserRoleMapper userRoleMapper;

    @Override
    public int saveUserRole(List<UserRole> userRole) {
        return userRoleMapper.saveUserRole(userRole);
    }

    @Override
    public int stopUseRole(Integer userid) {
        return userRoleMapper.stopUseRole(userid);
    }

    @Override
    public List<UserRole> selectUserRole(Integer roleId) {
        QueryWrapper<UserRole> wrapper = new QueryWrapper<UserRole>().eq("roleId", roleId);
        List<UserRole> userRoles = userRoleMapper.selectList(wrapper);
        return userRoles;
    }


}




